<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <div></div>
    <script>
        class Obderver{
            constructor(){
                this.message = {}
            }
        }
        const observer = new Obderver();
        console.log(observer.message);
        console.log(observer);
        console.log(this);
        // console.log(this.message);
        console.log(this.message = []);
        console.log(this.message.push(123,456));
        console.log(this.message);
        class Rectangle{
           // js类中声明成员变量(实例变量)
            constructor(width,height){
                this.width = width;
                this.height = height;
            }
            calcArea(){
                return this.width * this.height;
            }
        }
        const rectangle = new Rectangle(1,3);
        console.log(rectangle.calcArea());
    </script>
</body>
</html>